package gunPowderMod.block;

import net.minecraft.src.IBlockAccess;
import net.minecraft.src.MapColor;
import net.minecraft.src.Material;
import net.minecraft.src.World;
import net.minecraftforge.common.ForgeDirection;

public class Fuse extends AbstractBaseBlock{
	

	public Fuse(int blockId) {
		super(blockId, 5, Material.tnt);
		this.setBlockName("gpmFuse");
		this.setBlockBounds(0F, 0F, 0F, 1.0F, 0.0625F, 1.0F);
		this.blockIndexInTexture = 0;
	}	
	
	@Override
	public boolean isOpaqueCube(){
        return false;
    }
	
	@Override
	public int getRenderType(){
		return this.blockID;
	}
	
	/**
     * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
     */
	@Override
    public int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
    {
        return this.getBlockTextureFromSideAndMetadata(par5, par1IBlockAccess.getBlockMetadata(par2, par3, par4));
    }

    /**
     * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
     */
	@Override
    public int getBlockTextureFromSideAndMetadata(int par1, int par2)
    {
        return this.getBlockTextureFromSide(par1);
    }

    /**
     * Returns the block texture based on the side being looked at.  Args: side
     */
	@Override
    public int getBlockTextureFromSide(int par1)
    {
        return this.blockIndexInTexture;
    }
	
	@Override
	public boolean canPlaceBlockAt(World par1World, int x, int y, int z)
    {
        int blockIdOfBlockToReplace = par1World.getBlockId(x, y, z);
        int blockIdOfBlockBelow = par1World.getBlockId(x, y-1, z);
        return (blockIdOfBlockToReplace == 0 || blocksList[blockIdOfBlockToReplace].blockMaterial.isGroundCover()) && blocksList[blockIdOfBlockBelow].isOpaqueCube();
    }
	
	public static boolean isConnectedFuseBlock(IBlockAccess blockAccess,int x, int y, int z, int metaData, int face){
		
		return false;
	}
}
